package com.kuaiditu.assistant.api.xz_api.xz_encode;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by Eenie on 2017/8/15.
 * Email: eeniework@gmail.com
 * Des:
 */

public class KeyUtil {

    public static String buildKey(Date var0, String var1) {
        String var4;
        if(var1 != null && var0 != null) {
            int var2 = var1.length();
            String var3 = var1;
            if(var2 >= 2) {
                var3 = var1.substring(var2 - 2);
            }

            var4 = toFullStrWithoutMilli(var0) + var3;
        } else {
            var4 = null;
        }

        return var4;
    }

    public static String toFullStrWithoutMilli(Date var0) {
        return format(var0, "ss");
    }
    public static String format(Date var0, String var1) {
        SimpleDateFormat var3 = new SimpleDateFormat(var1);
        String var2;
        if(var0 == null) {
            var2 = "";
        } else {
            var2 = var3.format(var0);
        }

        return var2;
    }
}
